import GameRpc from "./GameRpc";

class SohpApi {
    private control: string = 'P900001'
    /**
    * 商城购买
    * @param 无
    * 
    * @return
    * code         | int      | 返回码
    * data         | id       | 商品id
    */
    public async BuyShopItem(id: number) {
        return await GameRpc.fetching({
            func: this.control + '.BuyShopItem',
            id: id
        })
    }

    /**
   * 外购
   * @param 无
   * 
   * @return
   * code         | int      | 返回码
   * data         | id       | 商品id
   */
    public async BuyItem(id: number) {
        return await GameRpc.fetching({
            func: this.control + '.BuyItem',
            itemid: id
        })
    }

    private controlTwo: string = 'P500001'

    /**
  * 外购第二次请求
  * @param 无
  * 
  * @return
  * code         | int      | 返回码
  * data         | id       | 商品id
  */
    public async fetching(order: string) {
        return await GameRpc.fetching({
            func: "bxs.goOrder",
            order: order,

        })
    }

}

export default new SohpApi()